// 以前通常都用javascript去封装一个事件通知类, 例如threeJs中的 EventDispatcher:
// https://github.com/mrdoob/three.js/blob/master/src/core/EventDispatcher.js
// 或是Vue或者React中比较熟知的Global.EventBus;

// EvntTarget是很多DOM元素实现的接口, 通过继承EventTarget接口实现事件管线的封装
class MessagePipeline extends EventTarget {

};

const pipeline = new MessagePipeline();

const MyEvent = new CustomEvent('MyEvent', {
    detail: {

    }
});

// pipeline.addEventListener(MyEvent.type, (e) => { console.log(e.detail) });
// pipeline.dispatchEvent(MyEvent);

